UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yxii20d9Z2JYN9QdFqX7fJC4g5lEOB0U2JMRX7O5WZc=' 
WHERE 
  key_id = '77b3218a3a12596f9f15e09caf8deed6f66ff8769ceee7e7758db9f9005a4496' 
  AND (
    token = 'Yxii20d9Z2JYN9QdFqX7fJC4g5lEOB0U2JMRX7O5WZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033