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