UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ph4GgNJw/ozup4aKtLkgau2WACh37ezFflZpRcTM9NU='
WHERE
key_id = '7b3d6790c7e8226496e059436a1028e8fc34fed07c5a1abd8b2291d3ce8d72d5'
AND (
token = 'Ph4GgNJw/ozup4aKtLkgau2WACh37ezFflZpRcTM9NU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)