UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/4ouGbcHEwCfiuBR2P371P5fsra/bxZPPpXy9ir3Rl4='
WHERE
key_id = '04dbe1c8df552e2355f34cc6db1a1ef06f8afdb7597cf347f71bcc7b7b15d592'
AND (
token = '/4ouGbcHEwCfiuBR2P371P5fsra/bxZPPpXy9ir3Rl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)