UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bR68Kx90MftxYvq7qfzF6v0RNeeAw6Il0QxZdcD+WaA='
WHERE
key_id = 'faa3fe7d233887bd91ead6712c29eae772a00632015587764a836752d9444396'
AND (
token = 'bR68Kx90MftxYvq7qfzF6v0RNeeAw6Il0QxZdcD+WaA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)