UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JBHYIIbL/ptWUGnyBFANqi90ljxD3ASFNzYaqKOnQF4='
WHERE
key_id = '6fb4cf409e06ae7aa5cde9e2ef2dea0cb1032d95b96e8e2d4d505d66ebfd6765'
AND (
token = 'JBHYIIbL/ptWUGnyBFANqi90ljxD3ASFNzYaqKOnQF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)