UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '07AB8hg6RIcY5asZmges1Q2hU1XViTu9qi3nHpR+V6M=' 
WHERE 
  key_id = '373ba02fcf32d121c929a29d83976077611ea57c35b458d8d7152cddf748eca6' 
  AND (
    token = '07AB8hg6RIcY5asZmges1Q2hU1XViTu9qi3nHpR+V6M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017