UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2b1CAYVaE2F0TyAIjpvo3Jn66sJMT2kj5W/AAfY+3o0='
WHERE
key_id = '84145d4ac04a6a8fa146324ae89709b75efd314e1285ed35c08bb47f341a8399'
AND (
token = '2b1CAYVaE2F0TyAIjpvo3Jn66sJMT2kj5W/AAfY+3o0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)