UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jiLgQjQbJQFkTaGaPL1BYct/UpqyBbJ/imDitysqeHw='
WHERE
key_id = 'bcd30ef97eaba66aad81f40ce3f95d17f3d8e32fb4c09562484a44fbc637ef59'
AND (
token = 'jiLgQjQbJQFkTaGaPL1BYct/UpqyBbJ/imDitysqeHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)