UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aZlJVRISpu5KQtsFS25DQfgVIgmpHA0ZC+N+Z9U5E6U='
WHERE
key_id = '8f8a4703bd033adf1b41317edbb3077bfcabb483fbd9e89d469c8e58f5e5b487'
AND (
token = 'aZlJVRISpu5KQtsFS25DQfgVIgmpHA0ZC+N+Z9U5E6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)