UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '96RR5B11iljFQ0cl42p9R1ExQFfdHe/RYs9EJha+m80='
WHERE
key_id = '56668873955859b4678b7aed119dab5f092ed5d1dfd252abe105c2e9d6888cc3'
AND (
token = '96RR5B11iljFQ0cl42p9R1ExQFfdHe/RYs9EJha+m80='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)