UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'evXivzvxeE4xmqRvjNm4Ph2LsR/u0FFhjJibE+EzvPM='
WHERE
key_id = '2c4cbe4df7e20cf9176a29cab3344d81d38fd46af3d8d250c7745a86da59633c'
AND (
token = 'evXivzvxeE4xmqRvjNm4Ph2LsR/u0FFhjJibE+EzvPM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)