UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uG4h4qbmE7UnQXwH/2ZcuLKiSuX5RBWU/1EVgXJ/MuI='
WHERE
key_id = '5a22efafda27b5bc120b82c2a541a0741a078035d34595989d1e9f928b18fd1a'
AND (
token = 'uG4h4qbmE7UnQXwH/2ZcuLKiSuX5RBWU/1EVgXJ/MuI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)