UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dDT/rUSgU1ZkyiP6VfVHx7CHehRNlUVbyTeMtEok6bY='
WHERE
key_id = '8a834bb4fe914ea776607f8b8fa312f51a2aeae61f17095ae192335233751a9c'
AND (
token = 'dDT/rUSgU1ZkyiP6VfVHx7CHehRNlUVbyTeMtEok6bY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)