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