UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uevJhKfjSdNpag4yaVmdObfbqYVpDB2Mv3pULxbIFxQ='
WHERE
key_id = '62b38bf9b8a44d5722a2eedfce3f284281970b425dc8803a2add2d9d41864e34'
AND (
token = 'uevJhKfjSdNpag4yaVmdObfbqYVpDB2Mv3pULxbIFxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)