UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r2jWw9XBnRInfj7WCJtiK7HEKkHPKPQ83bGRjsX0kXE='
WHERE
key_id = '1b5cadca6dd9f56f7af5bdcfa2ac010fd6bc65229fbfe1e0770b9a41c0147ef8'
AND (
token = 'r2jWw9XBnRInfj7WCJtiK7HEKkHPKPQ83bGRjsX0kXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)