UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YnQadyDy+VsqIy9hFwb018dEAFMD0J7xTipUGfesZ1I='
WHERE
key_id = 'c6940953e29a833140f9dae2a905925d916e21c6dc903e948e9298ffc872bc23'
AND (
token = 'YnQadyDy+VsqIy9hFwb018dEAFMD0J7xTipUGfesZ1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)