UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2lGne6RgY/MMh4d7FF+MnWUsU9BNRJq5mX8s5c2OjhY='
WHERE
key_id = '5426abdf19bd2fe8cc7aa25ab465eef7828822104dd4ab62490605ca6f9b31bb'
AND (
token = '2lGne6RgY/MMh4d7FF+MnWUsU9BNRJq5mX8s5c2OjhY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)