UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BDR+Ik4Nsrr7sLehlX+RJEDV9rKpZJiC7GkizQajFxQ='
WHERE
key_id = 'b357ce22c2faafee1d98fe0a7a6777ca3f1d883030e60c2c7011379cfd280946'
AND (
token = 'BDR+Ik4Nsrr7sLehlX+RJEDV9rKpZJiC7GkizQajFxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)