UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l0rAwd6l1N2FVz6Iv1fDlLS6HWlXDracTsCb6wIC6AQ='
WHERE
key_id = 'acccb0e8e0dcd171ebe9c623be68cfc90b7cb10f4a13d469c7bd363ef96af8f3'
AND (
token = 'l0rAwd6l1N2FVz6Iv1fDlLS6HWlXDracTsCb6wIC6AQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)