UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'POYeREz9Fn3he1Duyg54w+yUqT00AEd0i9CkUAUJjSo='
WHERE
key_id = '899ae4408ea8d09049a503e9e481fa290b94b99bc13d555fbeb22e50c3b0aa38'
AND (
token = 'POYeREz9Fn3he1Duyg54w+yUqT00AEd0i9CkUAUJjSo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)