UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wvpcLXo3pzGHbbobMEhspmG9tfUqrF0cn4sGPtWkhCM='
WHERE
key_id = '6d7dacf577d841ae4e01ca8f90e134fe6c161784fdfd6c4fc1fa2b7dc3b9d1ba'
AND (
token = 'wvpcLXo3pzGHbbobMEhspmG9tfUqrF0cn4sGPtWkhCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)