UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GUbYeoIZO3EkQWc801XF9Ln8nZvQLAqMs3RqqcIPKvI='
WHERE
key_id = 'd19dddc58be1d2f2897742e758eaa5dddafeaaf7ad1f888ee87d17e61f4142cf'
AND (
token = 'GUbYeoIZO3EkQWc801XF9Ln8nZvQLAqMs3RqqcIPKvI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)