UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qc93LfXrcAcb0Rrfc+WC9hNnEDRl2RhiKqNMgZrrGMk=' 
WHERE 
  key_id = 'b3c5ae0e6f6a5de836acca1b01c9f3a17613a134ec390ddc58d46f07dedfd7a0' 
  AND (
    token = 'qc93LfXrcAcb0Rrfc+WC9hNnEDRl2RhiKqNMgZrrGMk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045