UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ESN1XqOkEhYpXXGD3UWHIKwrbpCXsz/bhs+nrWNFbPI='
WHERE
key_id = '42f96d1177c41f809410545c779f733d74fc8a9df5753765f89432e35445e131'
AND (
token = 'ESN1XqOkEhYpXXGD3UWHIKwrbpCXsz/bhs+nrWNFbPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)