UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7cLHmO4/VX6gmFODsLwRir8CQEEtcZHYTOAxI40u8/k='
WHERE
key_id = 'a7ef1803337a67b549113e0c7aad93499865673557229c11f4db9f1ce72e09f4'
AND (
token = '7cLHmO4/VX6gmFODsLwRir8CQEEtcZHYTOAxI40u8/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)