UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cvy1waLzP6uCGEpbQBpACsMJj4jrbLJaeIaqBbmFLrA='
WHERE
key_id = '986cdc6b59ed5f901ef52783dd7b6d3d8acc7570eec91104fd6aa78e2a8f623e'
AND (
token = 'Cvy1waLzP6uCGEpbQBpACsMJj4jrbLJaeIaqBbmFLrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)