UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IZtRk+QIkwbWUiWAO47ytzgY+8sOtLbJdmWsf3Wgg6w='
WHERE
key_id = '99b2bcc4174c87eaeae88cd8ac96f34d9ad4c2952bd2363b4007189fa2b5e4d3'
AND (
token = 'IZtRk+QIkwbWUiWAO47ytzgY+8sOtLbJdmWsf3Wgg6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)