UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fpf6sf65fos2IlI5L602cQBiJFVRUYwwtlsrKh8AOnk='
WHERE
key_id = '91a4e3f03f70fa8c07ca049cbbc1c6b947fe0bc848aaed20a0cb68bcf07c07b7'
AND (
token = 'Fpf6sf65fos2IlI5L602cQBiJFVRUYwwtlsrKh8AOnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)